<?php

/*
 * 
 * Формирование прайс-листа xls
 */

class ControllerModulePricexls extends Controller {

    public function index() {

        $this->load->language('module/pricexls');
        $this->document->setTitle($this->language->get('heading_title'));


        $this->data['heading_title'] = $this->language->get('heading_title');
        $this->data['button_cancel'] = $this->language->get('button_cancel');
        $this->data['button_save'] = $this->language->get('button_save');
        $this->data['cancel'] = $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL');
        $this->data['button_delete'] = $this->language->get('button_delete');
        $this->data['text_delete'] = $this->language->get('text_delete');
        $this->data['text_delete2'] = $this->language->get('text_delete2');
        $this->data['text_delete3'] = $this->language->get('text_delete3');
        $this->data['text_delete4'] = $this->language->get('text_delete4');
        $this->data['button_action'] = $this->language->get('button_action');
        $this->data['exchange_delete_check'] = $this->language->get('button_action');
        $this->data['exchange_priority_text'] = $this->language->get('exchange_priority_text');


        if (isset($this->error['warning'])) {
            $this->data['error_warning'] = $this->error['warning'];
        } else {
            $this->data['error_warning'] = '';
        }



        $this->data['breadcrumbs'] = array();

        $this->data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_home'),
            'href' => $this->url->link('common/home', 'token=' . $this->session->data['token'], 'SSL'),
            'separator' => false
        );

        $this->data['breadcrumbs'][] = array(
            'text' => $this->language->get('text_module'),
            'href' => $this->url->link('extension/module', 'token=' . $this->session->data['token'], 'SSL'),
            'separator' => ' :: '
        );

        $this->data['breadcrumbs'][] = array(
            'text' => $this->language->get('heading_title'),
            'href' => $this->url->link('module/pricexls', 'token=' . $this->session->data['token'], 'SSL'),
            'separator' => ' :: '
        );

        $this->data['action'] = $this->url->link('module/pricexls', 'token=' . $this->session->data['token'], 'SSL');


     //   $this->load->model('setting/setting');
        
        
        if (isset($_POST)&& !empty($_POST)) {
		
                        $this->load->model('tool/pricexls');
                        $this->model_tool_pricexls->getExcelFile();
                     
		}
		
        
        
        
        
        $this->template = 'module/pricexls.tpl';
		$this->children = array(
			'common/header',
			'common/footer'	
		);   
     $this->response->setOutput($this->render(), $this->config->get('config_compression'));   
        
        
        
        
    }
    
    
     function install() {}
     
     
     protected function validate() {
		if (!$this->user->hasPermission('modify', 'module/account')) {
			$this->error['warning'] = $this->language->get('error_permission');
		}
		
		if (!$this->error) {
			return true;
		} else {
			return false;
		}	
	}


}

?>
